package cc.yaomm.service.basic.controller.business.user.biz;

import cc.yaomm.common.basic.domain.Paging;
import cc.yaomm.common.basic.util.BeanUtils;
import cc.yaomm.service.basic.controller.business.BaseAdminBiz;
import cc.yaomm.service.basic.controller.business.user.vo.ResourceParamVO;
import cc.yaomm.service.basic.controller.business.user.vo.ResourceResultVO;
import cc.yaomm.service.basic.service.user.ResourceService;
import cc.yaomm.service.basic.service.user.bo.ResourceParamBO;
import cc.yaomm.service.basic.service.user.bo.ResourceResultBO;
import ma.glasnost.orika.metadata.TypeBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.lang.reflect.Type;

@Service
public class ResourceBiz extends BaseAdminBiz {

    @Autowired
    private ResourceService resourceService;

    public Paging<ResourceResultVO> findPage(Paging<ResourceParamVO> paging) {
        Paging<ResourceParamBO> paramBOPaging = paging.convert(ResourceParamVO.class, ResourceParamBO.class);
        Paging<ResourceResultBO> result = resourceService.findPage(paramBOPaging);
        return result.convert(ResourceResultBO.class, ResourceResultVO.class);
    }

}
